filelist-from
Create a FileList from a path or a zip.
In order to make compatible code between the browser and node and to allow drag and drop of a folder it is useful to deal with FileList (that implements an Iterator of File).
This library allows to create such a FileList from a directory path (only available in nodejs) or from a zip file (available from nodejs and the browser).
Installation
npm i filelist-from
Usage
import { fileListFromPath } from 'filelist-from';
const fileList = fileListFromPath(join(__dirname));
import { fileListFromZip } from 'filelist-from';
const zip = readFileSync(join(__dirname, 'test.zip'));
const fileList = fileListFromZip(zip);
License
MIT